package com.zhentao.controller;

import com.zhentao.vo.Result;
import org.springframework.web.bind.annotation.*;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * 通知接口占位，保证前端正常运行
 * 前缀：/user/messages/notifications
 */
@RestController
@RequestMapping("/messages/notifications")
public class NotificationsController {

    /**
     * 获取通知列表（当前返回空列表）
     */
    @GetMapping
    public Result<Object> list(@RequestParam(required = false) Map<String, Object> params) {
        Map<String, Object> data = new HashMap<>();
        data.put("list", Collections.emptyList());
        return Result.success(data);
    }

    /** 获取未读数量 */
    @GetMapping("/count")
    public Result<Object> count() {
        Map<String, Object> data = new HashMap<>();
        data.put("count", 0);
        return Result.success(data);
    }

    /** 标记单条已读 */
    @PutMapping("/{id}/read")
    public Result<Object> markRead(@PathVariable String id) {
        return Result.success();
    }

    /** 批量标记已读 */
    @PutMapping("/batch-read")
    public Result<Object> batchRead(@RequestBody Map<String, Object> body) {
        return Result.success();
    }

    /** 批量删除 */
    @DeleteMapping("/batch")
    public Result<Object> batchDelete(@RequestBody(required = false) Map<String, Object> body) {
        return Result.success();
    }

    /** 清空 */
    @DeleteMapping
    public Result<Object> clearAll() {
        return Result.success();
    }
}

